package me.firstapp.common.module.bbs;

import java.util.Date;

import me.firstapp.common.module.base.JsonBase;
import me.firstapp.common.utils.DateUtils;

public class JsonTopicInManage extends JsonBase {

	private static final long serialVersionUID = -2809574532023539061L;

	// 与版块关联
	private Long sectionId;

	private String sectionName;

	// 标题
	private String title;

	// 摘要
	private String summary;

	// 内容
	private String content;

	// 发布时间
	private Date createTime;

	// 修改时间
	private Date modifyTime;

	// 点赞数
	private Long upCounts = 0L;

	// 浏览数
	private Long viewCounts = 0L;

	// 与用户的关联
	private Long memberId;

	private String memberName;

	// 回复数
	private Long replyCounts = 0L;

	// 收藏数
	private Long collectCounts = 0L;

	// 推荐标志
	private Integer recommend = 0;

	public JsonTopicInManage(JsonTopic topic) {
		this.id = topic.getId();
		this.sectionId = topic.getSection().getId();
		this.sectionName = topic.getSection().getName();
		this.title = topic.getTitle();
		this.summary = topic.getSummary();
		this.content = topic.getContent();
		this.createTime = topic.getCreateTime();
		// 如果为空，则默认为1990/12/09 00:00:00
		this.modifyTime = topic.getModifyTime() == null
				? DateUtils.getDateFromTimeStamp("660672000000", "yyyy-MM-dd HH:mm:ss") : topic.getModifyTime();
		this.upCounts = topic.getUpCounts();
		this.viewCounts = topic.getViewCounts();
		this.memberId = topic.getMember().getId();
		this.memberName = topic.getMember().getName();
		this.replyCounts = topic.getReplyCounts();
		this.collectCounts = topic.getCollectCounts();
		this.recommend = topic.getRecommend();
	}

	public Long getSectionId() {
		return sectionId;
	}

	public void setSectionId(Long sectionId) {
		this.sectionId = sectionId;
	}

	public String getSectionName() {
		return sectionName;
	}

	public void setSectionName(String sectionName) {
		this.sectionName = sectionName;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getSummary() {
		return summary;
	}

	public void setSummary(String summary) {
		this.summary = summary;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getModifyTime() {
		return modifyTime;
	}

	public void setModifyTime(Date modifyTime) {
		this.modifyTime = modifyTime;
	}

	public Long getUpCounts() {
		return upCounts;
	}

	public void setUpCounts(Long upCounts) {
		this.upCounts = upCounts;
	}

	public Long getViewCounts() {
		return viewCounts;
	}

	public void setViewCounts(Long viewCounts) {
		this.viewCounts = viewCounts;
	}

	public Long getMemberId() {
		return memberId;
	}

	public void setMemberId(Long memberId) {
		this.memberId = memberId;
	}

	public String getMemberName() {
		return memberName;
	}

	public void setMemberName(String memberName) {
		this.memberName = memberName;
	}

	public Long getReplyCounts() {
		return replyCounts;
	}

	public void setReplyCounts(Long replyCounts) {
		this.replyCounts = replyCounts;
	}

	public Long getCollectCounts() {
		return collectCounts;
	}

	public void setCollectCounts(Long collectCounts) {
		this.collectCounts = collectCounts;
	}

	public Integer getRecommend() {
		return recommend;
	}

	public void setRecommend(Integer recommend) {
		this.recommend = recommend;
	}

}
